<template>
  <div id="app">
    <el-container v-if="islogin">
        <el-aside width="225px" class="left">
          <left-nav />
        </el-aside>
        <el-container>
          <el-header height="50px" id="el-header">
            <Header />
          </el-header>
          <el-main id="main" :style="{minHeight:(offsetHeight-50)+'px' }">
            <div style="width: 100%;height: 100% ;background: #fff">
              <router-view/>
            </div>
          </el-main>
          <el-footer height="50px">
            <Footer />
          </el-footer>
        </el-container>
      </el-container>
    <el-container v-else>
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>

<script>
import Header from "@/components/pulic/layout/Header";
import LeftNav from "@/components/pulic/layout/LeftNav";
import Footer from "@/components/pulic/layout/Footer";
import "@/style/comment.css";
export default {
  name: 'App',
  components: {
    Header,LeftNav,Footer
  },

  data(){
    return{
      offsetHeight:0,
    }
  },

  computed:{
    islogin() {
      console.log('IN LOGIN')
      return this.$store.state.islogin;
    },
  },

  mounted() {
    this.$nextTick(()=>{
      this.offsetHeight = document.documentElement.clientHeight

    })
  },


}
</script>

<style>
body{
  margin:0;
}
#el-header{
  padding: 0;
  position: relative;
}

#main{
  padding: 10px 0 0 10px !important;
  width: 100%;
  background: #e9eef2;
}
</style>
